#include "globalvar.h"

GlobalVar::GlobalVar(){}

QMap<int, QString> GlobalVar::pairCharsMap=QMap<int,QString>{{'{', "{}"}, {'[', "[]"}, {'(', "()"}, {'\"', "\"\""}, {'\'', "\'\'"}};
QMap<QChar, QChar> GlobalVar::leftBracketMap=QMap<QChar, QChar>{{'{', '}'}, {'[', ']'}, {'(', ')'}};
QMap<QChar, QChar> GlobalVar::rightBracketMap=QMap<QChar, QChar>{{'}', '{'}, {']', '['}, {')', '('}};

QString GlobalVar::darkVScrollBarStyle = "QScrollBar:vertical{"  //垂直滑块整体
                      "background:rgb(64,64,64);"  //背景色
                      "padding-top:16px;"    //上预留位置（放置向上箭头）
                      "padding-bottom:16px;" //下预留位置（放置向下箭头）
                      "border-left:1px solid rgb(103,103,103);}"//左分割线
                      "QScrollBar::handle:vertical{"//滑块样式
                      "background:rgb(0,96,128);"  //滑块颜色
                      "border-radius:2px;"   //边角圆润
                      "border:1px solid rgb(136,136,136);"
                      "min-height:16px;}"//滑块最小高度
                      "QScrollBar::handle:vertical:hover{"//鼠标触及滑块样式hover,pressed
                      "background:rgb(0,160,192);}";

QString GlobalVar::darkHScrollBarStyle = "QScrollBar:horizontal{"  //垂直滑块整体
                      "background:rgb(64,64,64);"  //背景色
                      "padding-left:16px;"    //上预留位置（放置向上箭头）
                      "padding-right:16px;" //下预留位置（放置向下箭头）
                      "border-top:1px solid rgb(103,103,103);}"//左分割线
                      "QScrollBar::handle:horizontal{"//滑块样式
                      "background:rgb(0,96,128);"  //滑块颜色
                      "border-radius:2px;"   //边角圆润
                      "border:1px solid rgb(128,128,128);"
                      "min-width:16px;}"//滑块最小高度
                      "QScrollBar::handle:horizontal:hover{"//鼠标触及滑块样式hover,pressed
                      "background:rgb(0,160,192);}";

QString GlobalVar::lightVScrollBarStyle = "QScrollBar:vertical{"  //垂直滑块整体
                       "background:rgb(216,216,216);"  //背景色
                       "padding-top:16px;"    //上预留位置（放置向上箭头）
                       "padding-bottom:16px;" //下预留位置（放置向下箭头）
                       "border-left:1px solid rgb(192,192,192);}"//左分割线
                       "QScrollBar::handle:vertical{"//滑块样式
                       "background:rgb(255,255,255);"  //滑块颜色
                       "border-radius:2px;"   //边角圆润
                       "border:1px solid rgb(160,160,160);"
                       "min-height:16px;}"//滑块最小高度
                       "QScrollBar::handle:vertical:hover{"//鼠标触及滑块样式hover,pressed
                       "background:rgb(128,192,255);}";

QString GlobalVar::lightHScrollBarStyle = "QScrollBar:horizontal{"  //垂直滑块整体
                       "background:rgb(216,216,216);"  //背景色
                       "padding-left:16px;"    //上预留位置（放置向上箭头）
                       "padding-right:16px;" //下预留位置（放置向下箭头）
                       "border-top:1px solid rgb(192,192,192);}"//左分割线
                       "QScrollBar::handle:horizontal{"//滑块样式
                       "background:rgb(255,255,255);"  //滑块颜色
                       "border-radius:2px;"   //边角圆润
                       "border:1px solid rgb(160,160,160);"
                       "min-width:16px;}"//滑块最小高度
                       "QScrollBar::handle:horizontal:hover{"//鼠标触及滑块样式hover,pressed
                       "background:rgb(128,192,255);}";

//各种对比度主题的列表，顺序为典雅白，高级灰和酷炫黑。
QList<QColor> GlobalVar::defaultKeywordColor =QList<QColor>{QColor(0, 0, 128), QColor(86, 156, 216), QColor(128, 255, 255)};
QList<QColor> GlobalVar::defaultFunctionColor=QList<QColor>{QColor(0, 0, 128), QColor(192, 192, 255),QColor(255, 128, 128)};
QList<QColor> GlobalVar::defaultNumberColor =QList<QColor>{QColor(160, 0, 128), QColor(182, 232, 182), QColor(128, 255, 192)};
QList<QColor> GlobalVar::defaultSymbolColor =QList<QColor>{QColor(128, 0, 0), QColor(182, 206, 168), QColor(128, 255, 255)};
QList<QColor> GlobalVar::defaultQtClassColor =QList<QColor>{ QColor(128, 0, 128), QColor(156, 220, 255) , QColor(255, 128, 255)};
QList<QColor> GlobalVar::defaultPreprocessColor =QList<QColor>{ QColor(0, 0, 128) , QColor(212, 132, 192) , QColor(255, 255, 128)};
QList<QColor> GlobalVar::defaultCommentColor =QList<QColor>{ QColor(0, 128, 0) , QColor(120, 192, 120) , QColor(108, 212, 108)};
QList<QColor> GlobalVar::defaultStringColor =QList<QColor>{ QColor(0, 0, 255) , QColor(232, 160, 128) , QColor(232, 232, 0)};
QList<QColor> GlobalVar::defaultEditorForeground =QList<QColor>{ QColor(Qt::black) , QColor(156, 220, 255) , QColor(221, 221, 221)};

QList<QColor> GlobalVar::keywordColor =defaultKeywordColor;
QList<QColor> GlobalVar::functionColor=defaultFunctionColor;
QList<QColor> GlobalVar::numberColor =defaultNumberColor;
QList<QColor> GlobalVar::symbolColor =defaultSymbolColor;
QList<QColor> GlobalVar::qtClassColor =defaultQtClassColor;
QList<QColor> GlobalVar::preprocessColor =defaultPreprocessColor;
QList<QColor> GlobalVar::commentColor =defaultCommentColor;
QList<QColor> GlobalVar::stringColor =defaultStringColor;
QList<QColor> GlobalVar::editorForeground =defaultEditorForeground;

QList<QColor> GlobalVar::editorBackground =QList<QColor>{ QColor(Qt::white) , QColor(32, 32, 32) , QColor(Qt::black)};
QList<QColor> GlobalVar::warningColor =QList<QColor>{ QColor(64, 0, 128) , QColor(120, 192, 96) , QColor(192, 255, 128)};
QList<QColor> GlobalVar::errorColor =QList<QColor>{ QColor(Qt::darkRed) , QColor(220, 96, 96) , QColor(255, 128, 128)};
QList<QColor> GlobalVar::foregroundColor =QList<QColor>{ QColor(Qt::black) , QColor(221, 221, 221) , QColor(221, 221, 221) ,};
QList<QColor> GlobalVar::backgroundColor =QList<QColor>{ QColor(Qt::white) , QColor(32, 32, 32) , QColor(Qt::black)};
QList<QColor> GlobalVar::errorLineBackground =QList<QColor>{ QColor(255, 160, 160) , QColor(128, 64, 64) , QColor(128, 64, 64)};
QList<QColor> GlobalVar::errorLineForeground =QList<QColor>{ QColor(Qt::black) , QColor(Qt::white) , QColor(Qt::white)};
QList<QColor> GlobalVar::currentLineBackground =QList<QColor>{ QColor(255, 245, 212) , QColor(0, 56, 88) , QColor(0, 56, 88)};
QList<QColor> GlobalVar::extraSelectionBackground =QList<QColor>{ QColor(196, 222, 242) , QColor(96, 96, 32) , QColor(96, 96, 0)};
QList<QColor> GlobalVar::lineNumberAreaColor =QList<QColor>{ QColor(236, 236, 236) , QColor(64, 64, 64) , QColor(56, 56, 56)};

int GlobalVar::colorTheme=0;
QTranslator *GlobalVar::translator=new QTranslator;
